﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Engine.RuleEditor
{
    public partial class FormQuestion : Form
    {

        public FormQuestion()
        {
            InitializeComponent();
        }

        protected override void OnDeactivate(EventArgs e)
        {
            base.OnDeactivate(e);
            Close();
        }

        public static DialogResult Show(Control owner)
        {
            FormQuestion form = new FormQuestion();
            form.SetLocationToControlLeft(owner);
            return form.ShowDialog(owner);
        }

        public void SetLocationToControlLeft(Control control)
        {
            Point left = control.PointToScreen(new Point(control.Width, 0));
            SetDesktopLocation(left.X, left.Y);
        }
    }
}
